/**
 *
 * Copyright Pact Lab of H.I.T.
 *
 * Designed and Implemented by Grid Researching Group, 
 * Pact Lab, Harbin
 * 
 * This Project is part of the national 973 Project:
 * Internet Based Virtual Computing Environment
 *
 * http://pact518.hit.edu.cn
 * 
 * Author:       Meteor <meteorlxk@gmail.com> 
 * Copyright:    pact518 
 * Version:      1.0
 * Created:      2009-4-21 
 * LastModified: 2009-4-21
 */
package edu.hit.pact.pgse.communication.message;

import edu.hit.pact.pgse.bean.TaskPieceStatistics;

/**
 * This message is used for Crawlers send TaskPieceStatistics Command to Master.
 * @author Meteor
 *
 */
public class TaskPieceStatisticsMessage extends AbstractMessage{
	
	private static final long serialVersionUID = 4026885546493008413L;
	private TaskPieceStatistics statistics;
	
	/**
	 * 
	 * @param statistice
	 */
	public TaskPieceStatisticsMessage(TaskPieceStatistics statistics) {
		super(COMMUNICATION_TYPE.TASK_STATISTICS, false);
		this.statistics = statistics;
	}
	
    /**
	 * @return the statistics
	 */
	public TaskPieceStatistics getStatistics() {
		return statistics;
	}

	@Override
    public String toString() {
        // it is a good practice to create toString() method on message classes.
        return "(" + this.getType() + ")\n " + statistics.toString();
    }

}
